package douaPahare.frame;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;


public class ErrorFrame extends JFrame {
	
	private JPanel panel;
	private JLabel label;
	
	public ErrorFrame(String title,String mesaj) {
		setTitle(title);
		setSize(300,150);
		setResizable(false);
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		setLocation((int)dim.getWidth() / 2 - 150,(int)dim.getHeight() / 2 - 75);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		
		panel = new JPanel(new BorderLayout());
		panel.setBorder(new EmptyBorder(5,5,5,5));
		add(panel);
		
		label = new JLabel(mesaj);
		panel.add(label,BorderLayout.CENTER);		
	}

}
